package cn.bigcontainer.alt.workflow.po;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import cn.bigcontainer.alt.common.entity.BigMap;
import cn.bigcontainer.alt.common.po.BasePo;
import cn.bigcontainer.alt.common.po.Po;
import cn.bigcontainer.alt.common.util.WoKit;
import cn.bigcontainer.alt.meta.typehandler.BigMapHandler;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 流程当前任务
 * @author cailei
 * @create_date 2011-3-13
 */
@Data
@TableName(autoResultMap = true)
@Accessors(chain = true)
public class MRuntimeTask extends BasePo {

	@TableId(type = IdType.AUTO)
	protected Integer id;

	/**
	 * 流程定义id，MApp(type=workflow).id
	 */
	protected String processDefinitionId;

	protected String processInstanceId;

	protected String taskDefinitionId;

	/**
	 * 当某个任务需要多人同时执行时，该属性表示还有多少人需要执行该任务，0表示该任务已经完成，需要删除
	 */
	protected Integer candidates;

	@TableField(typeHandler = BigMapHandler.class)
	protected BigMap<String, Object> data = new BigMap<>();// text

	/**
	 * 创建时间
	 */
	protected Date createTime;

	/**
	 * 结束时间
	 */
	protected Date endTime;

	public MRuntimeTask(Po po) {
		WoKit.cloneBySetter(po, this);
	}

	public MRuntimeTask() {
	}

}
